package com.hackerrank.challenges.sayinghi;

import java.util.Scanner;

public class Solution {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		in.nextLine();
		for(int n = 0; n < N; n++) {
			String s = in.nextLine(), sl = s.toLowerCase();
			if(sl.startsWith("hi ") && !sl.startsWith("hi d"))
				System.out.println(s);
		}
	}
}
